package fun.ty13.feignClient;

import feign.hystrix.FallbackFactory;
import fun.ty13.domain.User;
import org.springframework.stereotype.Component;

/**
 * @author 桃缘十三
 * @date 2022/11/26 21:18
 */
@Component
public class UserFeignFallBackFactory implements FallbackFactory<UserFeignClient> {
    @Override
    public UserFeignClient create(Throwable throwable) {
        throwable.printStackTrace();
        return id -> new User(id,"服务降级");
    }
}
